<template>
	<view>
		<span class="icon iconfont icon-weizhi">222</span>
		aaa
		<newsVue></newsVue>
	</view>
</template>

<script>
	import newsVue from '../../components/news/news.vue';
	import {getNewsList} from '../../service/news.js'
	export default {
		components:{
			newsVue
		},
		data() {
			return {
				title: 'Hello',
				newsList:[],
				params:{key:"",type:1,page:1,psize:10}
			}
		},
		onReady(){
				console.log("页面生命周期函数-onReady");
		},
		onLoad() {
			
			uni.setStorageSync('storage_key', {name:"aaa"});
			
			console.log(333,uni.getStorageInfoSync());
			
			console.log("页面生命周期函数-onLoad");
			
			this.getNewsData();
 
		},
		onPageScroll(){
			 console.log("页面生命周期函数onPageScroll");
		},
		onResize() {
			 console.log("页面生命周期函数-onResize");
		},
		onUnload() {
			 console.log("页面生命周期函数-onUnload");
		},
		onShow() {
			console.log("页面生命周期函数-onShow");
		},
		// onNavigationBarButtonTap(){
		// 	console.log("页面生命周期函数-onNavigationBarButtonTap");
		// },
		onHide() {
			console.log("页面生命周期函数-onHide");
		},
		 
		methods: {
			
		   async getNewsData(){
				
			 const {data,errCode}=await getNewsList(this.params);
	 
			 if(errCode===10000){
				 this.newsList=data.list;
			 }
				
			},
			navigage(){
				uni.navigateTo({
					url:"/pages/free/free"
				})
				// uni.redirectTo({
				// 	url:"/pages/store/store"
				// })
				
			},
			toUser(){
				
				uni.switchTab({
					url:"/pages/user/index"
				})
				
			},
			submit(){
				console.log("提交");
			}

		}
	}
</script>

<style lang="less">
	// page{
	// 	background: transparent;
	// }
	.content{
		// background: skyblue;
		height: 100vh;
		width: 100%;
		display: flex;
		justify-content: center;
		.box{
			width:698rpx;
			height:310rpx;
			background: #ffffff;
			margin-top: 133rpx;
			
		}
	}
	
</style>
